﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" Inherits="Nivdal.Friends" Title="" StylesheetTheme="SkinFile" Codebehind="Friends.aspx.cs" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadPlaceHolder" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>

    <div class="basic_element">
    <div class="red_title">
       <asp:Label ID="PagetitleLabel" runat="server" CssClass="white_title" Text="<%$ Resources:Resource, Global_Friends %>"></asp:Label>
    </div>
    <div class="padding5">
        <asp:Panel ID="MessagePanel" runat="server">
            <asp:Label ID="MessageLabel" runat="server" SkinID="GreenSmallHeaderLabel"></asp:Label>
            <br />
        </asp:Panel>
        <asp:HyperLink ID="DetailsUpperLink" runat="server" SkinID="GreenTitleHyperLink"
         Text="<%$ Resources:Resource, FriendsDetails_PageTitle %>" NavigateUrl="~/FriendsDetails.aspx"></asp:HyperLink>
        <asp:Panel ID="SuggestionsPanel" runat="server">  
            <br />  
            <asp:Label ID="SuggestionsTitleLabel" runat="server" Text="<%$ Resources:Resource, Friends_SuggestionsTitleLabelText %>"
             SkinID="InfoLabel"></asp:Label>
            <br />
            <asp:GridView ID="SuggestionsGridView" runat="server" DataSourceID="SuggestionsDataSourse" AllowPaging="false" AutoGenerateColumns="false"
             SkinID="Professional" OnRowCommand="FriendshipCommand" Width="50%">
                <Columns>
                    <asp:TemplateField ItemStyle-Width="70%">
                        <ItemTemplate>
                            <asp:HyperLink ID="UserHyperlink" runat="server" SkinID="BlackHyperLinkSkin" Text='<%# Eval("UserName") %>'
                             NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>'></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField ItemStyle-Width="30%">
                        <ItemTemplate>
                            <asp:ImageButton ID="AcceptLinkButton" runat="server" ToolTip="<%$ Resources:Resource, Friends_AcceptLinkButtonText %>"
                             CommandArgument='<%# Eval("SuggestionId")%>' CommandName="Accept" ImageUrl="~/Images/Icons/friends.png" ></asp:ImageButton>
                             &nbsp;
                             <asp:ImageButton ID="DeclineLinkButton" runat="server" ToolTip="<%$ Resources:Resource, Friends_DeclineLinkButtonText %>"
                             CommandArgument='<%# Eval("SuggestionId")%>' CommandName="Decline" ImageUrl="~/Images/Icons/Friendship_Declined.png" 
                             OnClientClick='<%# DeclineFriendshipConfirm() %>'></asp:ImageButton>
                             &nbsp;
                             <asp:ImageButton ID="BlackListLinButton" runat="server" ToolTip="<%$ Resources:Resource, Global_BlackList %>"
                             OnClientClick='<%# DeclineFriendshipBlacklistConfirm() %>' CommandArgument='<%# Eval("SuggestionId")%>' CommandName="Blacklist" ImageUrl="~/Images/Icons/Friendship_Blacklist.png" ></asp:ImageButton>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
                <br /><br />
            <asp:SqlDataSource ID="SuggestionsDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
                    SelectCommand="Nivdal_FriendshipGetListOfFriendshipSuggestions" SelectCommandType="StoredProcedure" ></asp:SqlDataSource>
        </asp:Panel>
        <asp:Panel ID="MySuggestionsPanel" runat="server">
            <asp:Label ID="MySuggestionsTitleLabel" runat="server" Text="<%$ Resources:Resource, Friends_MySuggestionsTitleLabelText %>"
            SkinID="InfoLabel"></asp:Label>
            <br />
            <asp:GridView ID="MySuggestionsGridView" runat="server" AutoGenerateColumns="false" PageSize="30" AllowPaging="true" 
            DataSourceID="MySuggestionsDataSourse" SkinID="Professional" OnRowCommand="MySuggestionsCommand" Width="60%">
                <PagerSettings FirstPageText="<%$ Resources:Resource, FirstPage %>" LastPageText="<%$ Resources:Resource, LastPage %>"
                    Mode="NumericFirstLast" PageButtonCount="10" Position="Bottom" />
                <PagerStyle CssClass="pagination" HorizontalAlign="Center" />
                <Columns>
                    <asp:TemplateField HeaderText="<%$ Resources:Resource, Global_Date  %>">
                        <ItemTemplate>
                            <asp:Label ID="DateLabel" runat="server" SkinID="GridLabel" Text='<%# Eval("SuggestDate") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:HyperLink ID="UserNameHyperlink" runat="server" Text='<%# Eval("UserName") %>'
                             SkinID="GreenTitleHyperLink" NavigateUrl='<%# "~/UserPage.aspx?Id=" + Eval("UserId") %>'></asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField>
                        <ItemTemplate>
                            <asp:ImageButton ID="DeleteLinkButton" runat="server" ToolTip="<%$ Resources:Resource, Friends_DeleteSuggestionButtonToolTip %>"
                             ImageUrl="~/Images/Icons/delete.png" CommandArgument='<%# Eval("SuggestionId")%>' CommandName="DeleteSuggestion"/>
                            <asp:CheckBox ID="ToDeleteCheckBox" runat="server" />
                            <asp:HiddenField ID="SuggestionIdHiddenField" runat="server" Value='<%# Eval("SuggestionId")%>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                
                </Columns>
            </asp:GridView>
            <br /><br />
            <asp:Button ID="DeleteSelectedButton" runat="server" CssClass="GreenSmallButtonStyle"
            Text="<%$ Resources:Resource, InternalTeamMessages_DeleteSelectedButtonText %>" OnClick="DeleteSelected" />
            <asp:SqlDataSource ID="MySuggestionsDataSourse" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            SelectCommand="Nivdal_FriendshipGetListOfMyFriendshipSuggestions" SelectCommandType="StoredProcedure" ></asp:SqlDataSource>
        </asp:Panel>
        <br />
        <br />
        <asp:HyperLink ID="UserHyperlink" runat="server" SkinID="GreenTitleHyperLink" Text="<%$ Resources:Resource, FriendsDetails_PageTitle %>"
                             NavigateUrl="~/FriendsDetails.aspx"></asp:HyperLink>
        
    </div>
    </div>
    </ContentTemplate>
    </asp:UpdatePanel>
    
  </asp:Content>  

    
   
<asp:Content ID="Content3" ContentPlaceHolderID="PageNamePlaceHolder" Runat="Server">
    <asp:Label ID="PageNameLabel" runat="server" CssClass="PageNameContentStyle" Text="<%$ Resources:Resource, Global_Friends %>"></asp:Label>
</asp:Content>

